package com.ruoyi.system.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.ShopcarMapper;
import com.ruoyi.system.domain.Shopcar;
import com.ruoyi.system.service.IShopcarService;

/**
 * 购物车Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-06-06
 */
@Service
public class ShopcarServiceImpl implements IShopcarService 
{
    @Autowired
    private ShopcarMapper shopcarMapper;

    /**
     * 查询购物车
     * 
     * @param id 购物车主键
     * @return 购物车
     */
    @Override
    public Shopcar selectShopcarById(Long id)
    {
        return shopcarMapper.selectShopcarById(id);
    }

    /**
     * 查询购物车列表
     * 
     * @param shopcar 购物车
     * @return 购物车
     */
    @Override
    public List<Shopcar> selectShopcarList(Shopcar shopcar)
    {
        return shopcarMapper.selectShopcarList(shopcar);
    }

    /**
     * 新增购物车
     * 
     * @param shopcar 购物车
     * @return 结果
     */
    @Override
    public int insertShopcar(Shopcar shopcar)
    {
        return shopcarMapper.insertShopcar(shopcar);
    }

    /**
     * 修改购物车
     * 
     * @param shopcar 购物车
     * @return 结果
     */
    @Override
    public int updateShopcar(Shopcar shopcar)
    {
        return shopcarMapper.updateShopcar(shopcar);
    }

    /**
     * 批量删除购物车
     * 
     * @param ids 需要删除的购物车主键
     * @return 结果
     */
    @Override
    public int deleteShopcarByIds(Long[] ids)
    {
        return shopcarMapper.deleteShopcarByIds(ids);
    }

    /**
     * 删除购物车信息
     * 
     * @param id 购物车主键
     * @return 结果
     */
    @Override
    public int deleteShopcarById(Long id)
    {
        return shopcarMapper.deleteShopcarById(id);
    }
}
